THE AMIGANET BLITZ BASIC FAQ

AMIGA MODE

MESSAGE PORTS

Original message by Simon Archer


The below example will prompt you for a time in which to wait. Once entered, the routine will call the timer.device and wait for the specified time. It will then tell you when all is well.

It is a simple example, taken from the RKM Devices Third Edition, and shows how you should wait for a message from the OS via message ports. Any device operates very similar, including the serial.device, which was the original point raised IIRC.

Take a look.
Go to top of page.

EvWait

Original message by Simon Archer


For anybody who's interested, here's a proper example of how to wait for Ctrl_C. Compile this into an executable, and then run it from the shell. You can then either break it by hitting ^C or by issuing a 'Break' with the AmigaDOS command Break or with ARTM or similar. It doesn't matter how you do it, all that matters is that it sleeps while it's waiting and not running a loop!

Take a look.
Go to top of page.

WBScreenClone

Original message by Stephan Kortleven


How to setup a screen like the Workbench one.
Works with GFX boards!
Take a look.
Go to top of page.

SystemTagList

Original message by Stephan Kortleven


After a time searching for a good way to run programs from Blitz i find a way that could help many people i think. I did see there are many people having troubles finding there way in a good solution for running external programs from inside your own program. This will do the job in all cases. Except i think it will only work on OS2.0+ Amiga's.

Take a look.
The advantage of this system is :

If you choose to use #SYS_Asynch,1 the cli will be closed automaticly you could then choose some tag to let the cli open.

BUT ! If you close then the cli before the external task is finished you will have a crash. In this case we have to wait for some code at a own port whe have created. That's why i find using #SYS_Asynch,0 and the external program run a better and easyer way of doing what i wanna do.


Go to top of page.

PrimeNumber

Original message by Marcel Weber


Take a look.
Go to top of page.

LIST VIEW EXAMPLE

Original message by Simon Archer


Well here is an example of a fully working listview, just in case you get stuck, or even for reference......:

Take a look.
Go to top of page.

StringWord

Original message by Perry Mowbray


Is there a command similar to the word instruction from arexx where I can use X$=Word(A$,1) and if A$="The bees knees" then X$ would = "The" ?

Take a look.
Go to top of page.

GUIExample

Original message by Simon Archer


Take a look.
Go to top of page.

TextLength

Original example by Andrea Doimo


How to get the width in pixels of some text to print.
Take a look.
Go to top of page.

NameFromLock

Original message by Ronald Kuiper


If I make a Blitz-executable and run it (by double clicking on it's icon) how do I know which directory it was run from?

Take a look.
Go to top of page.

ScreenTags

Original example by Andrea Doimo
Modified & updated by Simon Ravn


The problem with ScreenTags is, that it's a statement (Yak! Acid!!), and therefore, if for some reason the screen can't be opened, you don't know and you can't do anything about it. So at the moment my MovieGuide crashes if you try to open a screen using a ModeID that isn't initialized (through the different monitor drivers). But all that will change soon, as I've found this easy solution to the problem, just using the library-function OpenScreenTags_:

Take a look.
Go to top of page.

PatternMatching

Original Example by Pat Meloy
Modified by Andrea Doimo


This example shows the use of the string matching function avaiable with our operative system.

Take a look.
Go to top of page.

ParseLha

Originl example by Jonathon Sutherland
Modified by Mark Stephens


This program doesn't extract the files within the .LHA archive, but simply shows infos about the contents...

Take a look.
Go to top of page.

WaitDisk

Original message by Richard T. Elmore


If you've got the ElmoreLibs upgrade on Bum6 installed, you can turn DOS requesters completely off with the SHOWREQUESTERS command. All requesters will act as if the CANCEL gadget had been pressed, so you can construct a routine that way. Here is an example that will wait until a disk is inserted into DF0: without ever bringing up a DOS requester!

Take a look.
Go to top of page.

BBSDoor

Original message by Andrea Doimo


I've written a small game, just for testing the key-reading. And it solves your problem...
Note for the game: You have to hit the key that appears before it reaches the right side of the screen :)
Take a look.
Compile and launch from the cli.
Good doors!

Go to top of page.

CTRL-C

Original message by Andrea Doimo


Take a look.
Go to top of page.

CONWindow

Original message by Robert Newman


Take a look.
Go to top of page.

RxSendAndReceive

Original message by Ronald Kuiper


Okay, here's some code with Arexx, hope you get it going :-)
Take a look.
Go to top of page.

ArexxSDuper

Original message by Craig Wilkinson


Hi There. Below is an example of accesing SuperDuper using Arexx via Blitz Basic hope it helps you, If you want more I've a few more examples.

Take a look.
Go to top of page.

SendArexxMex

Original message by Thomas Boerkel


This routine is stripped from BlitzBlankPrefs 2.50. It doesn't use Blitz2's ARexx-commands, but the ones from the OS and so works.

It sends the command 'BLANK' to BlitzBlank and then prints the resultstring ("OK").

Take a look.
Go to top of page.

ReceiveArexxMex

Original message by Thomas Boerkel


OK, I posted my BlitzBlank-routine to SEND an ARexx-message (did you see that one?), so why not post a routine from BlitzBlank which RECEIVES an ARexx-message:

Take a look.
Go to top of page.

AvailMem

Original message by Richard T. Elmore


There are some definitions in Amigalibs.Res that would make the flags easier to deal with. You can "OR" them together for combinations as well.

Here they are with a brief example:
Take a look.
Go to top of page.

ParseShapes

Original message by Andrea Doimo


Yeahh!!! I've done it!!! And it works! And It's fast! And It uses a buffer of 32 bytes!!!! :))

Ok, This program parse the file "ram:aaaa" (modify as you like) and will report if it's a shapes file, or not. I've assumed that the maximum size for a shape is 640 pixels wide, and 512 pixels tall, and obviously 1 to 8 bitplanes.

Shapes by 0x0 pixels and 0 bitplanes can be found, when not used. If any shape into the file doesn't follow these rules the file doesn't contain shapes at all!

Here it is!
Take a look.
Go to top of page.

WindowPattern

Example by Simon Ravn
Modified by Andrea Doimo


A small statement for filling windows with a background pattern that I use in MovieGuide Pro V2. First, the statement assumes that you've loaded your pattern as Bitmap number 5. It also assumes that you've examined the screen-structure using BMB's GUI SUPPORT library, using the ExScreen command!

If you don't do that, you'll have to change the following:

If those values doesn't give a good result, try other values, but using BMB GUI SUPPORT library is the most flexible way, as it will always be the right values no matter which font/screensize you're using!

Two more variables are needed by the statement, and they are:

OK on with it... After you've opened the window you can use the following syntax to fill it out using the Putpattern statement:

Syntax: Putpattern {Window,Close,Border}
Here's the statement that does it all:
Take a look.
Go to top of page.

BusyWindow

Original message by Simon Ravn


And here's another small routine for intuition programs that simply makes a BUSY/WAITING window that can be used to bring up messages in your program. It's nothing spectacular, but I use it a lot:-)

Some variables that has to be defined before calling this:

You should also have your window font loaded with LoadFont as font no. 1, but you can change this, of course!
Take a look.